from myhomework.common.daos import *
class SettingsMiddleware(object):
    def process_template_response(self, request, response):
        #print "SettingsMiddleware!!!!!!!!!!!!!"
        #print response.context_data
        
        return response
    
    def process_response(self, request, response):
        #print "process_response!!!!!!!!!!!!!"
        #print response.__class__
        
        #if(response.render):
           # print 'render!!!!!!!!!!!!!'
        
        return response
class FakeUploadCookieMiddleware(object):
   """TODO: replace the hardcoded url '/upload' with a 'reverse'."""
   def process_request(self, request):
       if request.path == '/upload/' and request.POST.has_key(settings.SESSION_COOKIE_NAME):
           request.COOKIES[settings.SESSION_COOKIE_NAME] = request.POST[settings.SESSION_COOKIE_NAME]